﻿
<RadzenStack AlignItems="AlignItems.Center" class="rz-py-4 rz-py-lg-6" Style="padding: var(--rz-panel-menu-item-padding); border-bottom: var(--rz-panel-menu-item-border);">
    <RadzenImage Path="images/logo.png" style="width: 48px; height: 48px;"></RadzenImage>
    <RadzenText Text="CRMBlazorWasmRBS" TextStyle="TextStyle.Subtitle1" class="rz-mb-0" style="color: var(--rz-primary-light);" />
</RadzenStack>
@CreateMenuContent(_menus)

@code {

    RenderFragment CreateMenuContent(IList<MenuModel>? currentMenus)
    {
        return
    @<RadzenPanelMenu>
        @if (currentMenus != null)
        {
            foreach (var menuInfo in currentMenus)
            {
                if (menuInfo.Children == null || menuInfo.Children.Count == 0)
                {
                    <RadzenPanelMenuItem Text="@menuInfo.Text" Path="@menuInfo.Url" Icon="@menuInfo.Icon" />
                }
                else
                {
                    <RadzenPanelMenuItem Text="@menuInfo.Text" Icon="@menuInfo.Icon">
                        @CreateMenuContent(menuInfo.Children)
                    </RadzenPanelMenuItem>
                }
            }
        }
    </RadzenPanelMenu>;
    }

}
